package main

import (
	"github.com/gin-gonic/gin"
	//_"bluebell/docs"
	gs "github.com/swaggo/gin-swagger"
	"github.com/swaggo/gin-swagger/swaggerFiles"
)

// @title bookdemoapi接口
// @version 1.2
// @description GO制作
// @termsOfService http://swagger.io/terms/

// @contact.name edxionxxx
// @contact.url http://www.swagger.io/support
// @contact.email support@swagger.io

// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
func main() {
	//db := sql()
	r := gin.Default()
	//查询全部
	r.GET("/books", GetAll)
	//修改
	r.POST("/books", Update)
	//添加
	r.PUT("/books", Put)
	booksgroup := r.Group("/books")

	//根据id删除
	booksgroup.DELETE("/:id", Del)
	//根据id查询
	booksgroup.GET("/:id", GeiById)
	//分页查询
	booksgroup.GET("/page/:pageNum/:pageSize", GetPage)
	//待条件的分页查询
	booksgroup.GET("/pagefind/:pageNum/:pageSize", GetPgeFind)
	r.GET("/swagger/*any", gs.WrapHandler(swaggerFiles.Handler))
	r.Run(":8088")
}
